<template>
	<view v-if="myMsg" style="width: 100%;display: flex;padding: 20rpx;flex-direction: row-reverse;">
		<image :src="$store.state.user.user.avatar"  style="width: 80rpx;height: 80rpx;border-radius: 8rpx;" mode=""></image>
		<!-- <image src="/static/images/ysj.png" style="width: 30rpx;height: 30rpx;margin-top: 25rpx;" mode=""></image> -->
		<view style="margin-right: 15rpx; background: none;max-width: 50%;border-radius: 0rpx;min-height: 80rpx;">
			<image @click="preImage" :src="src" style="max-width: 200rpx;" mode="widthFix"></image>
		</view>
	</view>
	<view v-else style="width: 100%;display: flex;padding: 20rpx;">
		<image :src="$store.state.gchat.group[group_id].members.find(e=>e.id == user_id).avatar" style="width: 80rpx;height: 80rpx;border-radius: 8rpx;" mode=""></image>
		<!-- <image src="/static/images/zsj.png" style="width: 30rpx;height: 30rpx;margin-top: 25rpx;" mode=""></image> -->
		<view style="background: none;max-width: 50%;font-size: 26rpx;border-radius: 0rpx;min-height: 80rpx;margin-left: 15rpx;">
			<image @click="preImage" :src="src" style="max-width: 200rpx;" mode="widthFix"></image>
		</view>
	</view>
</template>

<script>
	export default {
		name:"gmsgImageItem",
		data(){
			return {
				
			}
		},
		props:{
			src:{
				type:String,
				default:""
			},
			myMsg:{
				type:Boolean,
				default:false
			},
			user_id:{
				type:Number,
				default:0
			},
			group_id:{
				type:Number,
				default:0
			}
		},
		methods:{
			preImage:function(){
				uni.previewImage({
					current:0,
					urls:[this.src]
				})
			},
			
		}
	}
</script>

<style>
</style>